package BloodTimeHybernateDO;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.annotations.Proxy;

import dao.api.DataObject;

/**
 * 
 * @author Eduardo D. Sandoval V.
 * 
 */
@Entity
@Table(name = "visita")
@Proxy(lazy = false)
public class VisitaDO implements DataObject {
	
	// -------------------------------
	// Identificador auto-incremental
	// -------------------------------

	private int id;
	
	// -------------------------------
	// Probabilidad de ser atacado
	// -------------------------------
	
	private double probHordas;
	
	// ------------
	// Referencias
	// ------------
	
	private VampiroDO vampiroId;
	
	private CiudadDO ciudadId;

	@Override
	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE ,generator="visita_sequence")
	@SequenceGenerator(sequenceName = "visita_sequence", name = "visita_sequence", allocationSize = 1)
	public int getId() {
		return id;
	}

	@Override
	public void setId(int id) {
		this.id = id;
	}

	public double getProbHordas() {
		return probHordas;
	}

	public void setProbHordas(double probHordas) {
		this.probHordas = probHordas;
	}

	@ManyToOne
	public VampiroDO getVampiroId() {
		return vampiroId;
	}

	public void setVampiroId(VampiroDO vampiroId) {
		this.vampiroId = vampiroId;
	}

	@ManyToOne
	public CiudadDO getCiudadId() {
		return ciudadId;
	}

	public void setCiudadId(CiudadDO ciudadId) {
		this.ciudadId = ciudadId;
	}

}
